package com.ruoyi.cms.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cms.mapper.SysCmsLinkMapper;
import com.ruoyi.cms.domain.SysCmsLink;
import com.ruoyi.cms.service.ISysCmsLinkService;

/**
 * 友情链接Service业务层处理
 * 
 * @author he
 * @date 2025-06-24
 */
@Service
public class SysCmsLinkServiceImpl implements ISysCmsLinkService 
{
    @Autowired
    private SysCmsLinkMapper sysCmsLinkMapper;

    /**
     * 查询友情链接
     * 
     * @param id 友情链接主键
     * @return 友情链接
     */
    @Override
    public SysCmsLink selectSysCmsLinkById(Long id)
    {
        return sysCmsLinkMapper.selectSysCmsLinkById(id);
    }

    /**
     * 查询友情链接列表
     * 
     * @param sysCmsLink 友情链接
     * @return 友情链接
     */
    @Override
    public List<SysCmsLink> selectSysCmsLinkList(SysCmsLink sysCmsLink)
    {
        return sysCmsLinkMapper.selectSysCmsLinkList(sysCmsLink);
    }

    /**
     * 新增友情链接
     * 
     * @param sysCmsLink 友情链接
     * @return 结果
     */
    @Override
    public int insertSysCmsLink(SysCmsLink sysCmsLink)
    {
        sysCmsLink.setCreateTime(DateUtils.getNowDate());
        return sysCmsLinkMapper.insertSysCmsLink(sysCmsLink);
    }

    /**
     * 修改友情链接
     * 
     * @param sysCmsLink 友情链接
     * @return 结果
     */
    @Override
    public int updateSysCmsLink(SysCmsLink sysCmsLink)
    {
        return sysCmsLinkMapper.updateSysCmsLink(sysCmsLink);
    }

    /**
     * 批量删除友情链接
     * 
     * @param ids 需要删除的友情链接主键
     * @return 结果
     */
    @Override
    public int deleteSysCmsLinkByIds(Long[] ids)
    {
        return sysCmsLinkMapper.deleteSysCmsLinkByIds(ids);
    }

    /**
     * 删除友情链接信息
     * 
     * @param id 友情链接主键
     * @return 结果
     */
    @Override
    public int deleteSysCmsLinkById(Long id)
    {
        return sysCmsLinkMapper.deleteSysCmsLinkById(id);
    }
}
